package com.rmt.www.action;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.ServletActionContext;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;


import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.rmt.www.dao.ProjectDao;
import com.rmt.www.dao.UserDao;
import com.rmt.www.vo.Project;
import com.rmt.www.vo.User;


public class DeleteProjectAction extends ActionSupport{
	private List<String> pid;
	private ProjectDao projectDao;
	

	public ProjectDao getProjectDao() {
		return projectDao;
	}


	public void setProjectDao(ProjectDao projectDao) {
		this.projectDao = projectDao;
	}


	public List<String> getPid() {
		return pid;
	}


	public void setPid(List<String> pid) {
		this.pid = pid;
	}

	public void deleteProject(){
		int id;
		String tmp;
		for(int i=0;i<pid.size();i++){
			tmp=pid.get(i).trim();
		 	id=Integer.parseInt(tmp);
		 	projectDao.deleteProject(id);
		}
	}
	/*
	public String execute(){
		int id;
		for(int i=0;i<pid.size();i++){
			id=Integer.parseInt(pid.get(i));
			projectDao.deleteProject(id);
		}
		return "success";
	}
	*/
}
